It is common for threads to become serialized with processes to read entire directories within a storage system. In general, such a read operation from a directory, e.g., a “/home” directory, involves an operating system, a file system and a memory component that stores the /home directory. The operating system provides a buffer and transmits an offset along with the read request to the file system. The file system, based on the offset, reads a data block stored in the /home directory. The file system writes the read data in to the buffer and updates the offset value.
The operating system receives the updated offset value and transmits the updated offset value along another serial read request. The file system, based on the updated offset value, reads another data block from the /home directory and writes the read data into the buffer. This process continues until all the desired data is read from the directory once and only once.
One type of conventional serialized process places an exclusive lock on the directory being read, therefore, other processes are not able to use the directory while the exclusive lock is in place. This is not efficient. Increased computer usage and the Internet has led to an increase in content sharing including sharing files within directories. In other words, files within a directory may be accessed by one or more users, applications, clients, etc., simultaneously or serially. Unfortunately, exclusive access requests to files within the /home directory prevent the data from being shared with other types of requests.
Partitioning a directory helps to increase efficiency by allowing some partitions of the directory to be shared while others are being exclusively accessed. In order to accommodate exclusive access requests as well as other types of requests simultaneously, a directory may be partitioned. For example, the /home directory may be partitioned into additional subdirectories in order to facilitate multiple exclusive accesses simultaneously.
Unfortunately, partitioning the /home directory may cause a newly created entry to be missed during the read operation or if the directory is partitioned during a read operation, it may cause an entry to be read twice due to shuffling of the entries associated with the partitioning. Therefore, while partitioning of a directory may improve directory accessibility incident to a serialized process, it has the disadvantage of potentially missing a file in the read operation, e.g., listing operation, readdir operation, gedents operation, etc., or reading a file more than once and reporting it more than once to the operating system.